import { defineStore } from 'pinia'
import detailApi from '@/api/detail'

interface useStoreStateData {
  skuId: string | number
  skuNum: string | number
}
export const useAddCartStore = defineStore('cart', {
  state(): useStoreStateData {
    return {
      skuId: '',
      skuNum: ''
    }
  },
  actions: {
    async addGoodsCart(skuId: number, skuNum: number) {
      try {
        const res = await detailApi.reqAddGoods(skuId, skuNum)
      } catch (error) {
        return 'failed'
      }
    }
  },
  getters: {}
})
